Rebar Controls with LB
by Bill W.

You've probably seen a rebar control before. In Internet Explorer, they are used to help manage toolbars. Here's a screenshot of a rebar control, with two bands:

[screenshot goes here]

As you can see, a rebar control is just a parent window for different [i]bands[/i], which each contain a child control and a text label. They can be moved or resized by the user. By themselves, rebar controls are pretty much useless. But with the help of a child window, they can be much, much more.

A child window is any control, such as a combo box or text box. If you need to add more than one child window to a rebar control, you'll have to use a container control, which is explained by Alyce Watson in her article in Newsletter #108. [link to http://babek.info/libertybasicfiles/lbnews/nl108/tab.htm] Brent Thorn also wrote an article concerning container controls in newsletter #128. [link to http://babek.info/libertybasicfiles/lbnews/nl128/container.htm]

In my demo, child controls aren't needed. The wrapped version has three subroutines and one function to create and manage the control. While it is only enough for a minimalist implementation of a rebar control, this is really all that is needed.

I couldn't include all the resources needed for this article on one webpage, so you'll have to download a zip file. It contains two LB source files, this article, and a text file containing constants and structures for the rebar control.

click here to download the zip file.